[Bugfix #548] Fix analytics median, workspace scoping, remove activeBuilders#549
Merged
waleedkadous merged 5 commits intomainfrom Feb 24, 2026
Merged
Conversation
…atching, remove activeBuilders - Replace computeAvgHours with computeMedianHours for time-to-merge and bug close time (outliers no longer skew the result) - Rename avgTimeToMergeHours → medianTimeToMergeHours and avgTimeToCloseBugsHours → medianTimeToCloseBugsHours - Fix consultation workspace scoping: use prefix match (LIKE) instead of exact match so builder worktree paths (.builders/*) count toward the parent workspace's consultations - Remove activeBuilders from analytics response and dashboard
- Update dashboard test fixtures to use new property names (medianTimeToMergeHours, medianTimeToCloseBugsHours, no activeBuilders) - Fix stale doc comment in analytics.ts (removed builder count reference) - Fix stale test description string referencing avgTimeToCloseBugsHours - Fix inaccurate comment in metrics.ts about repo renames
Contributor
Author
Architect Integration ReviewVerdict: APPROVE All four fixes are clean and correct. Median implementation handles odd/even cases properly. Workspace prefix matching uses exact + LIKE with trailing slash normalization to avoid false positives (e.g. Architect integration review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four analytics fixes: switch time-to-merge and bug close time from average to median (outliers were skewing the average to 47h), fix consultation workspace scoping to use prefix match so builder worktree paths count, and remove the unused activeBuilders metric.
Fixes #548
Root Cause
computeAvgHours()used arithmetic mean — a few long-open bugs/PRs disproportionately skewed the resultworkspace_path = ?match — builder worktree paths like.builders/bugfix-535-...didn't match the parent workspaceactiveBuilderscount was not useful information in the analytics dashboardFix
computeAvgHourswithcomputeMedianHours(sorts durations, picks middle value)avgTimeToMergeHours→medianTimeToMergeHoursandavgTimeToCloseBugsHours→medianTimeToCloseBugsHoursacross API, types, and dashboard(workspace_path = ? OR workspace_path LIKE ?/%)prefix match with trailing-slash normalizationactiveBuildersfromAnalyticsResponse,computeAnalyticssignature, tower routes, and dashboard componentTest Plan
CMAP Review
To be added after review